<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
  <script type="text/javascript">
  function copy(){
	  document.getElementById('field2').value=
      document.getElementById('field1').value
 
  }
  function clearMe(){
	  document.getElementById('field2').value='';
  }
  </script>
 </head>
 <body>
  Field1: <input type="text" id="field1" value="Hello World!">
<br />
Field2: <input type="text" id="field2">
<br /><br />
双击下面的按钮，把 Field1 的内容拷贝到 Field2 中：
单击清空 Field2
<br />
<button value="clear" ondblclick=copy()
onclick=clearMe()>clear </button>
 </body>
</html>
